package cn.edu.scujcc;


	import java.util.List;
	import java.util.Optional;

	import org.springframework.beans.factory.annotation.Autowired;
	import org.springframework.stereotype.Service;

	@Service
	public class BroadcastService {
		@Autowired
		private BroadcastRepositroy repo;
		
		public List<Broadcast> getAllBroadcast(){
			List<Broadcast>result = null;
			result = repo.findAll();
			return result;
		}
		public Broadcast getBroadcast(String id) {
			Broadcast result = null;
			Optional<Broadcast> op = repo.findById(id);
			if (op.isPresent()) {
				result = op.get();
				}
			return result;
			}
		
		public Broadcast createComment(String id) {
			Broadcast result = null;
			Optional<Broadcast> op = repo.findById(id);
			if (op.isPresent()) {
				result = op.get();
				}
			return result;
			}
	}






